import pandas as pd

class ExcelDataClass:
    def __init__(self, excel_file_path, sheet_name='Sheet1'):
        # Read the Excel file
        df = pd.read_excel(excel_file_path, sheet_name=sheet_name)
        
        # Iterate through each column in the dataframe
        for column in df.columns:
            # Convert the column name to a valid Python identifier
            attr_name = column.lower().replace(' ', '_')
            
            # Set the attribute with the column's data
            setattr(self, attr_name, df[column].tolist())

    def __str__(self):
        return '\n'.join(f"{attr}: {getattr(self, attr)}" for attr in vars(self))

# Usage example
if __name__ == "__main__":
    excel_file_path = '/home/mich/Desktop/new_data.xlsx'
    data = ExcelDataClass(excel_file_path,sheet_name='v4')
    
    print(data)
    
    # Access individual variables
    print(data.column_name_1)  # Assuming 'Column Name 1' exists in the Excel file
    print(data.column_name_2)  # Assuming 'Column Name 2' exists in the Excel file
